home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.3 / Video Toaster v4.3.iso / 3.1 / toasterall / arexx_examples / tpaint / tpaintarexx.doc < prev    next >
Text File  |  1993-06-08  |  17KB  |  504 lines

  1. ToasterPaint ARexx Interface  6/93
  2.  
  3. Command Summary
  4.  
  5. In general, there are 4 groupings of action codes:  mouse, menu, button,
  6. and 'other' - codes that have no direct 'normal intuition interface'
  7. counterpart:
  8.  
  9. Mouse action codes are:
  10.  
  11.     Move x y
  12.     Pend  x y  (pen down)
  13.     Penu  x y  (pen up)
  14.  
  15. These work exactly as if the mouse (normal) pointer initiated the action. 
  16.  
  17. Some of the more common button action codes are:
  18.  
  19.         Undo; performs an undo operation
  20.         Scis; goes into scissors/cut-out-a-brush mode (Pend, Move and Penu action
  21.         codes actually do the cut)
  22.         Redo; does a 'repeat' or 'again'-type operation
  23.         Prgb r g b; sets the paint color, 4-bit RGB values
  24.         8rgb r g b; sets the paint color, 8-bit RGB values
  25.         Drre; draw rectangles" mode
  26.         Drci; "draw circles" mode
  27.         Dotb; "dotty (vs. smooth) brush" mode
  28.  
  29. More Action Code Notes
  30.  
  31. "Rdit" and "Dith" action codes:  setup the dither modes.  Dither only
  32. applies to Preview encoding.  (Current printer drivers only allow for 4
  33. bits per r,g,b color component.) ToasterPaint uses "random" dither by
  34. default.  The "Ugad" action code updates the user gadget display.  Many
  35. options can be set (or toggled) before forcing the display to update.  The
  36. display is not updated if there are any messages pending, which is the
  37. usual case with ARexx, so the "Ugad" code offers a way to update the
  38. display under "programmer control".
  39.  
  40. When using the file requester from ARexx, filenames and directory names are
  41. set up with the "Dnam" and "Fnam" action codes (messages).  Directories are
  42. actually "cd"d to when the "Dsel" action code is received.  The "Okls"
  43. action code acts like the "load/save,rgb/framestore/brush" button on the
  44. upper right side of the file requester.  It is used to actually begin the
  45. file loading or saving operation.
  46.  
  47. Action  Code List
  48.  
  49. 8rgb           paint color, 8 bit numbers, set bright white with "8rgb 255 255 255"
  50. Aali           anti-alias toggle
  51. Aaof       anti-alias OFF
  52. Aaon       anti-alias ON
  53. Al24       alloc 24-bit
  54. Aoff           all modes off
  55. Arof           always render - off
  56. Aron       always render - on
  57. Aroo       always render mode toggle
  58.  
  59. Babx       back box gadget, moves screens to back of display
  60. Bcmo       brush color mode toggle
  61. Bcop       copy brush
  62. Bdel           delete brush
  63. Blur           blur effect
  64. Blu2       blur effect, mode 2, "heavier blur"
  65. Boot       performs "keyboard file" "boot" codes
  66. Bres           restore brush
  67. Brgb       r,g,b background
  68. Brt2           - standard brush type
  69. Brt3           | brush
  70. Brt4           \ brush
  71. Brt5           / brush
  72. Brt6           "squares"
  73. Brt7           "circles"
  74. Bsmf       "filled in freehand"...flood on, bsmooth...
  75. Bsmo       "smooth-connected" std brush (vs. dotty-disconnected)
  76. Bswa       swap the "swap brush"
  77. Bsz1       standard brush size select
  78. Bsz2       brush size 1
  79. Bsz3       brush size 2
  80. Bsz4       brush size 3
  81. Bsz5       brush size 4 
  82. Bsz6       brush size 5
  83. Bsz7       brush size 6
  84. Bszl           brush size, one larger
  85. Bszs       brush size, one smaller
  86. Btog       brush shape toggle,flips btwn brush shapes
  87. Bwpa       black and white palette for Preview
  88.  
  89. Cbx0       color box 0, palette color select
  90. Cbx1       color 1
  91. Cbx2       color 2
  92. Cbx3       color 3
  93. Cbx4       color 4
  94. Cbx5       color 5
  95. Cbx6       color 6
  96. Cbx7       color 7
  97. Cbx8       color 8
  98. Cbx9       color 9
  99. Cbxa       color 10
  100. Cbxb       color 11
  101. Cbxc       color 12
  102. Cbxd       color 13
  103. Cbxe       color 14
  104. Cbxf       color 15(last "real" palette color)
  105. Cbxg       'current/front/ color, left range color
  106. Cbxh       'background/shadow' color, right range color
  107. Cbxi       PAINT color (de-selects range front/back color)
  108. Clbx       escape button, hires closebox
  109. Clrs           CLeaR Screen
  110. Coof       coords off
  111. Coon       coords on
  112. Coor       toggles coord flag
  113. Cpic           Copy picture to swap screen
  114. Ctrl           control tools/sliders on/off
  115.  
  116. Dela           delay on bottom of screen, before scroll
  117. Delo           delay off
  118. Depa       default palette
  119. Dflt           load default files keyboard.txt and gadget.pic
  120. Dir0           df0: directory selection for file requester
  121. Dir1           df1: directory selection for file requester
  122. Dir2           df2: directory selection for file requester
  123. Dir3        RAM: directory selection for file reqeuster
  124. Dir4        dh0: directory selection for file requester
  125. Dirp           "/"  parent directory selection for file requester
  126. Dirr           ":"  root directory selection for file requester
  127. Dith           matrix dither toggle
  128. Dlva         DeLiVer" a line of ASCII rgb's to ToasterPaint {n,line#,n(r g b)}  all 
  129.         parameters are ascii, for example, " 320  10   60 20 180 ..."        " #pts 
  130.             line#   60=1st red valu 120=green 180=blue"
  131. Dlvb       "DeLiVer" a line of BINARY rgb's to ToasterPaint         
  132.                 {n,line#,n(r.w,g.w,b.w)}
  133. Dnam       dirname string
  134. Dotb       single dot brush
  135. Doty       dotty brush (vs. 'smooth')
  136. Drar           ellipse
  137. Drci           circle
  138. Drln           line mode
  139. Drre           rectangle
  140. Drrf           filled rectangles (1x mode tools)
  141. Dsel           directory selection
  142. Dswa       Delete swap screen
  143.  
  144. Endm       end magnify mode
  145. Exec        Execute an AmigaDOS command
  146.  
  147. Fa24       fail/quit if not in 24 bit rgb mode
  148. Fbof       framestore load, left/rightside pixel blacken, - off
  149. Fbon       framestore load, left/rightside pixel blacken, - on
  150. Fboo       framestore load, left/rightside pixel blacken, mode toggle
  151. Film           fill mode toggle
  152. Fiof           fill mode off
  153. Fion           fill mode on
  154. Flix           Brush flip horizontal
  155. Fliy           Brush flip vertical
  156. Flof           Flood off
  157. Flon           Flood on
  158. Floo           Flood on/off
  159. Flpx           any flip horizontal
  160. Flpy           any flip vertical
  161. Fnam       filename string
  162. Font           Load Font file requester
  163. Frbx       front box gadget
  164. Fsel           file selection
  165. Fu24       fail/quit if rgb mode, but no undo buffer
  166.  
  167. Grmo       grid mouse - use mouse to specify a 2 endpoints (rectangle)
  168. Grof       grid off
  169. Gron       grid-lock on
  170. Grst           ## ## grid start x,y (upper left corner)
  171. Grto           grid toggle on-off.
  172. Grxy       ## ## grid size x, y
  173. Gxdn       Grid X decrement
  174. Gxup       Grid X 'up' - increment
  175. Gxva       Grid X value 16 bit
  176. Gydn       Grid Y decrement
  177. Gyup       Grid Y 'up' - incr
  178. Gyva       Grid y value 16 bit
  179.  
  180. Harr           toggle 1 way horizontal blend
  181. Hvar       toggle button, 2 way h/v blend
  182. Hvof       set 2 way blend gadget OFF
  183. Hvsh       2 way gadget (blending) imagery reset
  184. Hvst       2 way gadget (TxMap) imagery reset
  185.  
  186. Ke24       keep 24 bit buffers in between "selects" (from switcher)
  187. Ksdn       down arrow scroll
  188. Kslt           left arrow scroll
  189. Ksrt           right arrow scroll
  190. Ksup      up arrow scroll
  191.  
  192. Lo24          Load RGB file requester
  193. Load       call up load requester (for file, or brush, or font)
  194. Lobr       Load Brush file requester
  195. Loco       load-composite - uses switcher/framestore directory for default
  196.  
  197. Magn       magnify gadget
  198. Maxc       max buttons for blend center
  199. Maxe       max for blend Edge
  200. Maxw       max for TxMap amt
  201. Meof       memory display - off
  202. Meon       memory display - on
  203. Meoo       memory display mode toggle
  204. Midc       middle setting for blend center
  205. Mide       middle setting for blend Edge
  206. Midw       middle setting for TxMap amt
  207. Minc       min buttons for blend center
  208. Mine       min for blend Edge
  209. Minw       min for TxMap amt
  210. Move       x,y position
  211. Mswa       Merge swap screen
  212.  
  213. Noef       no effect, turn off all effects
  214.  
  215. Okls           ok load/save button
  216.  
  217. Pale           turn on/off PALETTE tools
  218. Pcca           print - cancel
  219. Pcfe           print - "fewer" copies
  220. Pcmo       print - "more" copies
  221. Pcok       print - ok button; initiate printing
  222. Pend       x,y pen down, big pic assumed
  223. Penu       x,y pen up
  224. Pick           turn on/off pick mode
  225. Pixy           pick from x,y (in message - remote/arexx only)
  226. Pmad       paint mode - add
  227. Pman       paint mode - and
  228. Pmcl       paint mode - clear (normal)
  229. Pmco       paint mode - colorize
  230. Pmdn       paint mode - darken
  231. Pmln       paint mode - lighten
  232. Pmor       paint mode - or
  233. Pmso       paint mode - solid/normal
  234. Pmsu       paint mode - subtract
  235. Pmxo       paint mode - xor
  236. Pot0           center blend slider setting pot 
  237. Pot1           edge blend slider setting pot
  238. Pot5           TxMap amt, slider setting
  239. Poth           shade hor pos, blend hotspot
  240. Potv           shade ver pos, blend hotspot
  241. Prfl           prop gadget for scrolling file/dir names,on file requester
  242. Prgb       r,g,b paint (4 bit/Preview mode colors)
  243. Prin           Print requester
  244. Pro0       refresh blend sliders
  245. Pro1       prop routines, handle 'auto increment by one'
  246. Pro5       TxMap amt prop
  247. Pund       Palette Undo
  248.  
  249. Quia           Quit - but ask with requester
  250. Quit           Quit - return to switcher without unloading
  251.     
  252. Rang       range mode immediate, combo w/other paint modes
  253. Rdit           flip random dither
  254. Redo       again/redo button
  255. Rema       Remap to new palette
  256. Rotm       Brush rotation MINUS 90 degrees (counter-clock)
  257. Rotp       Brush rotation PLUS 90 degrees
  258. Rubi       simple rub thru on
  259. Rubt       rub thru paint mode
  260.  
  261. Sa24       save 24-bit
  262. Sabr           Save Brush
  263. Saco       save-composite - render toaster-24 bit to a frame-store file
  264. Sbru       source - brush image instead of paint color
  265. Scis           scissors/cut gadget
  266. Scof           scroll lock - off
  267. Scon       scroll lock - on
  268. Scoo       scroll lock mode toggle
  269. Shar           toggle 1 way horizontal
  270. Shcf           show composite OFF
  271. Shco       show composite
  272. Shof       shift off, for   locking rectangle->swap brush aspect ratio
  273. Shon       shift on, for un-locking rectangle->swap brush aspect ratio
  274. Shoo       show overscan
  275. Shva       toggle button, 2 way h/v TxMap mode
  276. Sizi           TxMap/sizing effect
  277. Snap       'snap centered view'...keeps toaster hires pic centered
  278. Snof       snap off
  279. Spoh       hor pos - TxMap hotspot
  280. Spov       ver pos - 2 way TxMap hotspot
  281. Squt           ~ keyboard...super-quit...asks switcher for "unload from memory"
  282. Srgb       source - rgb color instead of brush image (default)
  283. Svar           toggle vertical TxMap mode
  284. Swap       swap screens menu option
  285.  
  286. Tbbo       text button bold
  287. Tbit           text button italic
  288. Tbun       text button underline
  289. Tdv1       toaster dv1 (1st frame buffer)
  290. Tdv2       toaster dv2 (2nd frame buffer)
  291. Tgof       toaster gadgets off (no render button)
  292. Tgon       toaster-type gadget handling (default)
  293. Toof       1x mode off
  294. Toon       x mode on...this is for "hires display"
  295. Tran           transparent on/off (menu item)
  296. Trgb       r,g,b transparent
  297. Trof           transparent background color off
  298. Tron       transparent background color on
  299. Tstr           text string gadget
  300. Ttog           blend 2-way direction toggle
  301. Tvar           data for text string (ascii)
  302. Txbt           text tools select
  303. Txdn       Tile X value, decrement
  304. Txma       txmap mode immediate
  305. Txup       Tile X 'up' - increment
  306. Txva       Tile X value 16 bit << 4 (in increments of 1/16)
  307. Tydn       Tile Y value - decrement
  308. Tyup       Tile Y 'up' - increment
  309. Tyva       Tile y value 16 bit << 4 (in increments of 1/16)
  310.  
  311. Ugad       redo user gadget (hires+hamtools) display, waits for rendering to finish
  312. Undo       undo button
  313.  
  314. Varr           toggle vertical blend
  315. Vwco       view composite - render to Toaster
  316.  
  317. Warp       (INTERNAL only) simple turn on TxMap
  318. Wexp       whole screen expand...go "zoom", non-interlace, superbitmap
  319. Wham       whole Preview screen re-do (from rgb data), re-displays entire Preview 
  320.             image
  321. Whoo       whole screen toggle (1x/2x button's action code)
  322. Wshr       whole screen shrink...go skinnier, interlace
  323. Wtog       TxMap 2-way direction toggle
  324.  
  325.  
  326. ToasterPaint acts as a 'server' with regards to ARexx.  ToasterPaint will
  327. not issue calls to ARexx, since it doesn't have a "macro" capability.
  328. Therefore all ARexx applications need to be run from 'outside' ToasterPaint
  329. (e.g.  from a CLI).  The ARexx program should include the statement
  330. "address DigiPaint".  However, the action code "Exec", which simply calls
  331. the AmigaDos execute function, can be used to start up macros by including
  332. the AmigaDos "run" command.
  333.  
  334. Example -
  335.  
  336. ?    Exec run rx test.rexx
  337.  
  338. or
  339.  
  340. ?    Exec run execute dostest.txt
  341.  
  342. The KEYBOARD FILE is named "ToasterPaint_Startup/keyboard.txt".  It is a
  343. simple (edit-able) ascii file.  Each line contains a "raw key code", a
  344. blank (space character), and an action code to occur when the key is
  345. pressed.  Multiple lines (actions) can be "tied" to each key by having more
  346. than one line per key in the keyboard shortcut file.  The action codes are
  347. processed in the order that they appear in the file.Note that the action
  348. codes for the ARROW KEYS are somewhat tied to the real-time Control Panel:
  349. they either move the screen, or they move the magnify view, depending on
  350. the mouse position.  The keyboard shortcut file also contains another type
  351. of entry:  "BOOT" codes.  The are two "BOOT" code classes, "BOOT" and
  352. "Boot".  "BOOT" codes only "happen" once, as the program is starting,
  353. before any screens are opened.  They're used primarily to setup default
  354. conditions.  "Boot" codes occur after the screens are opened, and every
  355. time the program is re-entered from the switcher.
  356.  
  357.  
  358.  
  359. Examples - File Requester, Font Loading, Making Text Brushes, Painting
  360. These examples can be executed as CLI/Shell command files.  Place the code
  361. in a file named "testcode".  Then use the AmigaDOS command "execute
  362. testcode".  Outline, with 1 pixel, a rectangle from 50,49 to 100,99
  363.  
  364. ?    hey DigiPaint Drre
  365. ?    hey DigiPaint Dotb
  366. ?    hey DigiPaint 8rgb 160 160 160
  367. ?    hey DigiPaint Pend 50 49
  368. ?    hey DigiPaint Penu 100 99
  369.  
  370. Load a file named "DEF" from disk named "ABC:"
  371.  
  372. ?    hey DigiPaint Load
  373. ?    hey DigiPaint DnamABC:
  374. ?    hey DigiPaint Dsel
  375. ?    hey DigiPaint FnamDEF
  376. ?    hey DigiPaint Okls; load font from file named "FONTS:TOPAZ/11"
  377. ?    hey DigiPaint Font
  378. ?    hey DigiPaint Dnam FONTS:TOPAZ
  379. ?    hey DigiPaint Dsel
  380. ?    hey DigiPaint Fnam11
  381. ?    hey DigiPaint Okls
  382. ?    hey DigiPaint Clbx
  383.  
  384. Put "dropshadow"ed text on picture;...by making a dark gray brush, pasting
  385. it, then doing same with light gray.
  386.  
  387. ?    hey DigiPaint 8rgb 80 80 80
  388. ?    hey DigiPaint TvarHello
  389. ?    hey DigiPaint Tstr
  390. ?    hey DigiPaint Pend 100 99
  391. ?    hey DigiPaint 8rgb 160 160 160
  392. ?    hey DigiPaint Tstr
  393. ?    hey DigiPaint Pend 98 97
  394.  
  395. ToasterPaint, being a true 24 bit rgb paint program, operates on every
  396. pixel with (more than) 24 bit resolution.  Each red, green and blue
  397. component is treated as an 8 bit quantity, with an additional 8 bits used
  398. for blending.  ToasterPaint can be used as a rendering utility.  External
  399. programs can generate 24-bit rgb data and send the data into ToasterPaint's
  400. buffers.  The data can then be saved as rgb files, framestores, rendered to
  401. a Toaster frame buffer, or otherwise processed.  The "Dlvb" action code
  402. (explained further on in this section) is used for this.
  403.  
  404. The following examples are given in the format used for rexx scripts.
  405. DRAWING LINES
  406. Instead of the 'Drln' mode, it's best to use the "Bsmo" (connected
  407. brushstroke) mode in order to draw lines.  Instead of
  408.   'Drln'
  409.   'Pend' 50 50
  410.   'Penu' 100 100
  411. it's better to use
  412.   'Bsmo'
  413.   'Pend' 50 50
  414.   'Penu' 100 100
  415. The ('Bsmo') "be smooth"/connected brushstroke mode will paint all of the
  416. in-between positions, bt drawing a line between the starting ('Pend') and
  417. ending ('Penu') brush positions.  'Drln' is fairly unusable from ARexx.
  418. It's only available from ARexx for the sake of 'logical completeness'.
  419.  
  420. FRAMESTORE SAVE FILENAMES
  421.  
  422. The (minimal) "correct" way to save a framestore is with the following action codes:
  423.     'Saco'
  424.     'Fnam123.FS.Test'
  425.     'Okls'
  426.  
  427. Note that the filename *must* be prefixed with "###.FS." if the switcher is
  428. to recognize this framestore file.  If you do not include this string at
  429. the beginning of a framestore filename, then the switcher will not be able
  430. to load the file (although ToasterPaint still can).  Also, be sure not to
  431. use duplicate frame numbers because the switcher will only recognize 1
  432. framestore file per frame number.
  433.  
  434. PAINT COLOR
  435.  
  436. "Prgb"/DigiPaint(old) is for setting up a 12 bit paint color.
  437. "8rgb"/ToasterPaint   is for setting up a 24 bit paint color.
  438. For "Prgb r g b", each r,g,b value is a  4 bit number (0-15  range).
  439. For "8rgb r g b", each r,g,b value is an 8 bit number (0-255 range).
  440.  
  441.  
  442. SCANLINE INTERFACE
  443.  
  444. The 'Dlva' and 'Dlvb' action codes (commands) are similar.
  445. 'Dlvb' takes binary numbers (UWORDs) as parameters.
  446. 'Dlva' takes ascii (normal string) arguments.
  447. 'Dlva' is somewhat slower because of the ascii->binary (internal) conversion.  It's format
  448. is:
  449.    Dlva #pixels line# r g b r g b r g b r g b r g b ... r g b
  450.  
  451. 'Dlvb' was designed to be a quick machine language interface for scan line
  452. rendering.  (DigiView4 uses this exact same command to send it's image into
  453. DigiPaint's "buffer".  DigiView and DigiPaint are two other NewTek
  454. products.) The 'Dlvb' format looks something like:
  455.   ULONG  'Dlvb'
  456.   UWORD  nbr_pixels
  457.   UWORD  line_nbr
  458.   UWORD  red_0
  459.   UWORD  green_0
  460.   UWORD  blue_0
  461.    --- "many" groups of red,green,blue values, 1 group per pixel
  462.   UWORD  red_n
  463.   UWORD  green_n
  464.   UWORD  blue_n
  465.  
  466. Remember, the "r g b" numbers are 10bit values (range of 0-1023).  (Bright
  467. white's rgb data would be "1023 1023 1023", not "15 15 15".)
  468.  
  469. Here's an example program...
  470. ---
  471. /* "Dlva" test program, Arexx to DigiPaint interface ***************/
  472.  
  473. address 'DigiPaint' /* host name */
  474.  
  475. nlines = 128 /* # of lines to display */
  476. row = 20     /* (starting) line #, used by the 'Dlva' message */
  477. gray = 0
  478.  
  479. do nlines    /* for each of 128 lines */
  480.  
  481.              /* setup r,g,b values for current lines */
  482.   r = gray
  483.   g = gray
  484.   b = gray
  485.  
  486.              /* setup 32 pixels on this row */
  487.   msg$ = ''
  488.   do 32
  489.      msg$ = msg$ r g b
  490.   end
  491.  
  492.              /* setup 320 pixels = 10 groups of 32 pixels */
  493.   msg$ =  msg$ msg$ msg$ msg$ msg$ msg$ msg$ msg$ msg$ msg$
  494.  
  495.              /* send 'Dlva' msg to DigiPaint/ToasterPaint */
  496.  'Dlva' '320' row msg$
  497.  
  498. gray = gray + 1024/nlines  /* rgb values range from 0..1023 */
  499. row = row + 1              /* used by the 'Dlva' message */
  500. end                        /* 128 lines of 'gray' */
  501.  
  502. return
  503. /************************* end of program **************************/
  504.